#include <stdio.h>
#include <stdlib.h>


int main(int argc, char * argv[])
{
    int tmp, val, max_thd_per_blk;
    val = atoi(argv[1]);
    max_thd_per_blk = atoi(argv[2]);
    printf("The initial value of variable `val` is %d\n", val);
    printf("The initial value of variable `max_thd_per_blk` is %d\n", max_thd_per_blk);
    tmp = max_thd_per_blk;
    while (tmp > 0)
    {
        if (tmp < val)
        {
            tmp *= 2;
            break;
        }
        else if (tmp == val)
        {
            break;
        }
        tmp /= 2;
    }
    printf("The final value of variable `tmp` is %d\n", tmp);
    return 0;
}
